<!doctype html>
<html>
<head>
	<title>Dojo Spring Integration Demo</title>
	<style type="text/css">
      @import "dojoroot/dojox/grid/resources/claroGrid.css";
      @import "dojoroot/dojo/resources/dojo.css"
  	</style>
  	<script type="text/javascript" src="dojoroot/dojo/dojo.js"
    data-dojo-config="parseOnLoad: true"></script> 

<script type="text/javascript">
			dojo.require("dojox.rpc.Service");
			dojo.require("dojox.rpc.JsonRPC");
			dojo.require("dojox.grid.DataGrid");
			dojo.require("dojo.data.ItemFileReadStore");
			
</script>
<script type="text/javascript" src="js/smd/vesselSMD.smd.js"></script>
<script>
			var grid, store;
			
			var layout=[
						{ name: "ID", field: "id", width:"10" },
						{ name: "Call Sign", field: "callSign", width:"10" },
						{ name: "English Name", field: "englishName", width:"30" },
						{ name: "Chinese Name", field: "chineseName", width:"30" }
			      
			    ];
			
			dojo.ready(function(){
				
				grid = new dojox.grid.DataGrid({
					id: 'grid',
					autoHeight:true,
					structure: layout
				}, "grid");
				grid.startup();
				
				vesselService.fetch({}).then(
					function(response){
						store = new dojo.data.ItemFileReadStore(
								{data: {
									items:response.data
									}
								}
							);
						grid.setStore(store);
					}		
				);
			}
		);
			
		</script>
</head>
<body>
<h1>Demo: Dojo Spring Integraion </h1>
		<br/>
		<div id="grid"></div>
</body>
</html>